package xuxiu;

import cn.xuxiu.App;
import cn.xuxiu.bacsic.util.PageList;
import cn.xuxiu.org.domain.Shop;
import cn.xuxiu.org.query.ShopQuery;
import cn.xuxiu.org.service.ILogininfoService;
import cn.xuxiu.org.service.IShopService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.ArrayList;
import java.util.List;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = App.class)
public class SpringTest3 {

    @Autowired
    private IShopService ShopService;

    @Autowired
    private ILogininfoService logininfoService;

    @Autowired
    private IShopService shopService;

    @Test
    public void test1() throws Exception{
        ShopService.loadAll().forEach(System.out::println);
    }

    @Test
    public void test2() throws Exception{
        ShopQuery shopQuery = new ShopQuery();
        shopQuery.setCurrentPage(1);
        shopQuery.setPageSize(5);
        PageList<Shop> shopPageList = ShopService.queryPage(shopQuery);
    }
    @Test
    public void test3() throws Exception{
        logininfoService.loadAll().forEach(System.out::println);
    }

    @Test
    public void test4() throws Exception{
        shopService.loadAll().forEach(System.out::println);
    }
    @Test
    public void test5() throws Exception{
        List<Long> list = new ArrayList();
        list.add(38l);
        shopService.batchRemove(list);
    }

}
